<template>
<div class="home-box">
    <p>Home组件</p>
    <router-link :to="{name:'MovieDetails',params:{id:3}}">跳转到M_details组件</router-link>
    <a href="#" @click.prevent="gotoMovie(2)">跳转到M_details组件</a>
</div>
</template>

  <script setup>
import { useRouter } from 'vue-router';
const router = useRouter();
const gotoMovie = movieId => {
    router.push({name: "MovieDetails", params: {id:movieId}});
};
</script>
<style scoped>
.home-box {
    amin-height: 150px;
    background-color:  plum;
    padding: 15px;
}
</style>